/**
 * 
 */
package com.hfjyz.exam.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.validation.Errors;
import org.springframework.web.servlet.mvc.SimpleFormController;

import com.hfjyz.exam.command.ExamResultCommand;
import com.hfjyz.exam.service.PaperService;

/**
 *
 */
public class ExamResultController extends SimpleFormController {
	private PaperService paperService;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.springframework.web.servlet.mvc.SimpleFormController#referenceData
	 * (javax.servlet.http.HttpServletRequest, java.lang.Object,
	 * org.springframework.validation.Errors)
	 */
	@SuppressWarnings("rawtypes")
	@Override
	protected Map referenceData(HttpServletRequest request, Object command,
			Errors errors) throws Exception {
		ExamResultCommand cmd = (ExamResultCommand) command;
		return paperService.initExamResult(request, cmd, errors);
	}

	/**
	 * @return the paperService
	 */
	public PaperService getPaperService() {
		return paperService;
	}

	/**
	 * @param paperService
	 *            the paperService to set
	 */
	public void setPaperService(PaperService paperService) {
		this.paperService = paperService;
	}
}
